package com.yangle.frame.admin.service;

import com.yangle.frame.admin.entity.FrameCode;
import com.yangle.frame.admin.mapper.FrameCodeMapper;
import com.yangle.frame.common.service.BaseService;
import com.yangle.frame.common.utils.MapperUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import java.util.Arrays;
import java.util.List;

/**
* Created by yangle on 2018/5/27.
*/
@Service
public class FrameCodeService implements BaseService<FrameCode> {
@Autowired
private FrameCodeMapper frameCodeMapper;

public List<FrameCode> getAll(FrameCode frameCode) {
Example example = MapperUtils.getExampleByClass(FrameCode.class, frameCode);
return frameCodeMapper.selectByExample(example);
}

public void create(FrameCode frameCode) {
    frameCodeMapper.insert(frameCode);
}

public void update(FrameCode frameCode) {
frameCodeMapper.updateByPrimaryKey(frameCode);
}

public FrameCode select(String id) {
return frameCodeMapper.selectByPrimaryKey(id);
}

public void delete(String ids) {
frameCodeMapper.deletes(Arrays.asList(ids.split(",")));
}
}
